#include "Configuration.h"
#include <fstream>
#include <sstream>
#include <iostream>

Configuration::Configuration(const string &filepath)
    :_filepath(filepath)
{
    std::ifstream ifs(_filepath);
    if(!ifs){
        perror("ifstream");
    }
    string line;
    while(getline(ifs,line))
    {
        std::istringstream iss(line);
        string key,value;
        iss>>key>>value;
        _configMap.insert(make_pair(key,value));
    }
    ifs.close();
}

map<string,string> & Configuration::getConfigMap()
{
    return _configMap;
}
